{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <form class="form-horizontal" method="post">
            <input type="hidden" name="id" value="{$name.id|default=0}" />
            <div class="col-md-8">
                {include file="public/tophead"}
                {include file="public/top" /}
                <div class="ibox-content">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">账户：</label>
                        <div class="col-sm-9">
                            <input name="name" type="text" class="form-control" value="{$name.name|default=''}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">密码：</label>
                        <div class="col-sm-9">
                            <input name="password" type="password" class="form-control" value="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">确认密码：</label>
                        <div class="col-sm-9">
                            <input name="password2" type="password" class="form-control" value="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">客服：</label>
                        <div class="col-sm-9">
                            <div class="radio i-checks">
                                <label>
                                    <input type="radio" value="1" name="is_customer_service" {if empty($name.is_customer_service) or $name.is_customer_service eq 1}checked="checked"{/if} />是
                                </label>
                                <label>
                                    <input type="radio" value="0" name="is_customer_service" {if isset($name.is_customer_service) and $name.is_customer_service eq 0}checked="checked"{/if} />否
                                </label>
                            </div>
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 只能设置一个为客服账号，其它账号会背覆盖，请谨慎填写！</span>
                        </div>
                    </div>
                </div>
            </div>
            {if empty($name.id) or $name.id neq 1}
            <div class="col-md-4">
                <div class="ibox-title">
                    <h5>其他设置</h5>
                </div>
                <div class="ibox-content">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">权限：</label>
                        <div class="col-sm-8">
                            <select class="form-control" name="type" onchange="chan(this);">
                                {volist name="admintype" id="at"}
                                <option value="{$at.id}" data_city="{$at.title}" {if isset($name.type) and $at.id eq $name.type}selected="selected"{/if}>{$at.title}</option>
                                {/volist}
                            </select>
                        </div>
                    </div>
                    <div class="form-group" id="city" {if empty($name.title) or $name.title neq '城市代理'}style="display:none;"{/if}>
                        <label class="col-sm-3 control-label">代理城市：</label>
                        <div class="col-sm-8">
                            <input name="city" class="form-control" placeholder="只需填写代理城市名,如 广州市 或 广州 。无需添加其他字符,以免影响" value="{$name.city|default=''}" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">账户状态：</label>
                        <div class="col-sm-8">
                            <div class="radio i-checks">
                                <label>
                                    <input type="radio" value="1" name="hide" {if empty($name.hide) or $name.hide eq 1}checked="checked"{/if} />正常账户
                                </label>
                                <label>
                                    <input type="radio" value="0" name="hide" {if isset($name.hide) and $name.hide eq 0}checked="checked"{/if} />禁用账户
                                </label>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            {/if}
        </form>
    </div>
</div>
{include file="public/footer" /}
{load href="__STYLE__/admin/plugins/iCheck/icheck.min.js"}
{load href="__STYLE__/admin/plugins/iCheck/custom.css"}
<script type="text/javascript">
$(document).ready(function(){
    $(".i-checks").iCheck({
        checkboxClass: "icheckbox_square-green",
        radioClass: "iradio_square-green",
    })
});
function chan(obj){
    if($(obj).find('option:selected').attr('data_city') !=='城市代理'){
        $('#city').hide();
    }else if($(obj).find('option:selected').attr('data_city')=='城市代理'){
        $('#city').show();
    }
}
</script>
{include file="public/bottom" /}